package com.JFapp.domain.entity;

import java.util.Date;

import com.JFapp.annotation.validator.group.register;
import com.JFapp.annotation.validator.group.update;
import com.JFapp.annotation.validator.name.IsPhone;
import com.JFapp.annotation.validator.name.Unique;
import com.JFapp.annotation.validator.name.UniqueName;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.validation.constraints.NotBlank;

/**
 * 计服用户表(User)表实体类
 *
 * @author makejava
 * @since 2024-03-13 21:26:07
 */
@SuppressWarnings("serial")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("jf_user")
public class User {
    @TableId
    private Long id;
    //用户名@TableId

    @UniqueName
    @NotBlank(groups = {register.class, update.class}, message = "名称不能为空")
    private String userName;

    //昵称
    private String nickName;
    //密码
    @NotBlank(groups = {register.class}, message = "密码不能为空")
    private String password;
    //用户类型
    private String type;
    //帐号状态
    private String status;
    //邮箱
    @Unique(groups = {register.class, update.class})
    private String email;
    //手机号
    @IsPhone(groups = {register.class, update.class})
    @Unique(groups = {register.class, update.class})
    private String phoneNum;
    //性别
    private String sex;
    //头像
    private String avatar;
//    @TableField(fill = FieldFill.INSERT)
    //创建人
    private Long createBy;
    //创建时间
//    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    //更新人
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;
    //更新时间
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    
    private Integer delFlag;


}
